import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";

/**
 * VersionList - 数据审计模态框-版本列表
 * @date: 2019/5/9
 */
import React, { PureComponent } from 'react';
import { Table } from 'antd';
import intl from "../../utils/intl";
/**
 * 数据审计模态框-版本列表
 * @extends {PureComponent} - React.PureComponent
 * @reactProps {Array} dataSource - 版本列表数据
 * @reactProps {Boolean} loading - 数据加载完成标记
 * @reactProps {Function} onChange - 切换版本列表分页
 * @reactProps {Function} onFetch - 查询详情列表
 * @return React.element
 */

var VersionList = /*#__PURE__*/function (_PureComponent) {
  _inherits(VersionList, _PureComponent);

  var _super = _createSuper(VersionList);

  function VersionList() {
    _classCallCheck(this, VersionList);

    return _super.apply(this, arguments);
  }

  _createClass(VersionList, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          dataSource = _this$props.dataSource,
          loading = _this$props.loading,
          onFetch = _this$props.onFetch,
          pagination = _this$props.pagination,
          _onChange = _this$props.onChange;
      var columns = [{
        title: intl.get('cpaas.common.components.dataAudit.version').d('版本'),
        dataIndex: 'entityVersion',
        width: 200,
        render: function render(text, _ref) {
          var auditDataId = _ref.auditDataId;
          return /*#__PURE__*/React.createElement("a", {
            onClick: function onClick() {
              return onFetch(auditDataId);
            }
          }, text);
        }
      }, {
        title: intl.get('cpaas.common.components.dataAudit.operationType').d('操作类型'),
        dataIndex: 'auditTypeMeaning',
        width: 200
      }, {
        title: intl.get('cpaas.common.explain').d('说明'),
        dataIndex: 'remark',
        width: 100
      }];
      return /*#__PURE__*/React.createElement(Table, {
        rowKey: "auditDataId",
        bordered: true,
        columns: columns,
        dataSource: dataSource,
        pagination: pagination,
        loading: loading,
        onChange: function onChange(page) {
          return _onChange(page);
        }
      });
    }
  }]);

  return VersionList;
}(PureComponent);

export { VersionList as default };